package cn.iocoder.an.module.mold.dal.mysql.linestopregistration;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.linestopregistration.LinestopRegistrationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.linestopregistration.vo.*;

/**
 * 停线登记 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LinestopRegistrationMapper extends BaseMapperX<LinestopRegistrationDO> {

    default PageResult<LinestopRegistrationDO> selectPage(LinestopRegistrationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LinestopRegistrationDO>()
                .betweenIfPresent(LinestopRegistrationDO::getRegistrationDate, reqVO.getRegistrationDate())
                .likeIfPresent(LinestopRegistrationDO::getWorkshopName, reqVO.getWorkshopName())
                .likeIfPresent(LinestopRegistrationDO::getProposer, reqVO.getProposer())
                .eqIfPresent(LinestopRegistrationDO::getCategory, reqVO.getCategory())
                .likeIfPresent(LinestopRegistrationDO::getQuestion, reqVO.getQuestion())
                .likeIfPresent(LinestopRegistrationDO::getReason, reqVO.getReason())
                .betweenIfPresent(LinestopRegistrationDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(LinestopRegistrationDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(LinestopRegistrationDO::getDuration, reqVO.getDuration())
                .likeIfPresent(LinestopRegistrationDO::getResponsibleDepartment, reqVO.getResponsibleDepartment())
                .eqIfPresent(LinestopRegistrationDO::getRespersonids, reqVO.getRespersonids())
                .eqIfPresent(LinestopRegistrationDO::getRespersons, reqVO.getRespersons())
                .eqIfPresent(LinestopRegistrationDO::getNumberOfAffected, reqVO.getNumberOfAffected())
                .betweenIfPresent(LinestopRegistrationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LinestopRegistrationDO::getId));
    }

}